#include "stm32f10x.h"
#include "mpu6050.h"
#include "delay.h"
#include "usart.h"	
#include "I2CMPU6050.h"
#include "motor.h"
#include "tim.h"
#include "pid.h"
#include "balance.h"
#include "exti.h"
#include "kalman.h"

 int main(void)
 {	
	 
	NVIC_PriorityGroupConfig(NVIC_PriorityGroup_2);
	SystemInit();
	delay_init();
	 
		
	MOTOR_GPIO_Config();
	PWM_Init();
  Encoder_TIM3_Init();
  Encoder_TIM4_Init();
	 
	EXTIX_Init();
	uart_init(9600);
	I2C_GPIO_Config();
	MPU6050_Init(); 
	 
	Kalman_Init(); 
	 
  while(1)
	{
//		USART_SendData(USART1,1);
//		delay_ms(1000);
	//	Usart1_ctr(Res);
		
	}
 }

